package com.sushi.dao.impl;

import com.sushi.pojo.User;
import com.sushi.dao.UserDao;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

//@Repository("userDaoxx")
public class UserDaoImpl implements UserDao {
    private int age;
    private String name;

    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public UserDaoImpl() {
    }

    public UserDaoImpl(int age, String name, User user) {
        this.age = age;
        this.name = name;
        this.user = user;
    }

    public int getAge() {
        return age;
    }

    public String getName() {
        return name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void checkLife() {
        System.out.println("I'm giving dao...");
    }
    @PostConstruct
    public void myInit() {
        System.out.println("自定义方法名初始化......");
    }
    @PreDestroy
    public void kill() {
        System.out.println("自定义方法名销毁......");
    }

//    @Override
//    public Context getInitialContext(Hashtable<?, ?> environment) throws NamingException {
//        return null;
//    }
//
//    @Override
//    public void destroy() throws Exception {
//        System.out.println("接口的销毁");
//    }
}
